/**
 * 
 */
package com.ra.model.product;

import static javax.persistence.FetchType.LAZY;

import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Entity;

import org.hibernate.search.annotations.Analyzer;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Store;

/**
 * @author rp
 *
 */
@Entity
@Indexed
@Analyzer(impl=org.apache.lucene.analysis.standard.StandardAnalyzer.class)
public class Product {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Id
	@DocumentId
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	
	public Long getId() {
		return id;
	}
	
	private String code;
	
	@Field(name="productName", index=Index.TOKENIZED, store=Store.NO)
	private String name;
	
	@Field(name="productDescription", index=Index.TOKENIZED, store=Store.NO)
	private String description;
	
	private String image; //TODO:
	
	@Field(name="productCategory", index=Index.TOKENIZED, store=Store.NO)
	private String category;
	
	@Field(name="productSubcategory", index=Index.TOKENIZED, store=Store.NO)
	private String subCategory;

	/**
	 * @return the code
	 */
	public String getCode() {
		return code;
	}

	/**
	 * @param code the code to set
	 */
	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the image
	 */
	public String getImage() {
		return image;
	}

	/**
	 * @param image the image to set
	 */
	public void setImage(String image) {
		this.image = image;
	}

	/**
	 * @return the category
	 */
	public String getCategory() {
		return category;
	}

	/**
	 * @param category the category to set
	 */
	public void setCategory(String category) {
		this.category = category;
	}

	/**
	 * @return the subCategory
	 */
	public String getSubCategory() {
		return subCategory;
	}

	/**
	 * @param subCategory the subCategory to set
	 */
	public void setSubCategory(String subCategory) {
		this.subCategory = subCategory;
	}

	/**
	 * @param descreption the description to set
	 */
	public void setDescription(String description) {
		this.description = description;
	}

	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}
}
